package cn.lin.listener;

import cn.lin.domain.Quick;
import cn.lin.mapper.QuickMapper;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zxy
 * @date 2024/12/6 18:28
 * 监听点击抢答的组件
 */
@Component
public class QuickListener {

    @Autowired
    private QuickMapper quickMapper;

    @RabbitListener(queues = "quick.queue")
    public void processQuick(Quick quick){
        System.out.println("监听到抢答信息");
        quickMapper.addQuickPerson(quick) ;
        System.out.println("执行完毕");
        //是否删除redis中的抢答人数资源?
    }

}
